Skip to content

Disable callbacks when extension is disabled#661

Open
adieyal wants to merge 3 commits into
mainfrom
bug/initialize-properties-before-exit
Open

Disable callbacks when extension is disabled#661
adieyal wants to merge 3 commits into
mainfrom
bug/initialize-properties-before-exit

Conversation

@adieyal

@adieyal adieyal commented Nov 5, 2023

Copy link
Copy Markdown
Owner

Ensure that callbacks (apart from settings and wildcards manager), only run when dynamic prompts is enabled. This builds on #648

@adieyal adieyal requested a review from akx November 5, 2023 21:42
@adieyal adieyal changed the title Bug/initialize properties before exit Disable callbacks when extension is disabled Nov 6, 2023

@akx akx left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd probably call the variable script_protocol just script for brevity – or maybe both the type name and the variable should be e.g. SDDPScript and sddp?

@adieyal

adieyal commented Nov 6, 2023

Copy link
Copy Markdown
Owner Author

and keep the module name the same? script_protocol? or change it to sddp_script?

@adieyal adieyal force-pushed the bug/initialize-properties-before-exit branch from 29d47bc to 5ef7740 Compare November 6, 2023 07:27
@akx

akx commented Nov 6, 2023

Copy link
Copy Markdown
Collaborator

Now that I think of it, I'm not sure the protocol is actually required at all – couldn't we just use the actual script object as a type (guarded against circular imports)?

if TYPE_CHECKING:
    from dynamic_prompts.dynamic_prompting import Script as SDDPScript

@adieyal

adieyal commented Nov 6, 2023

Copy link
Copy Markdown
Owner Author

Now that I think of it, I'm not sure the protocol is actually required at all – couldn't we just use the actual script object as a type (guarded against circular imports)?

if TYPE_CHECKING:
    from dynamic_prompts.dynamic_prompting import Script as SDDPScript

Happy to do that too. I'll make the change.

Ensure that callbacks (apart from settings and wildcards manager), only run when dynamic prompts is enabled. This builds on #648
@adieyal adieyal force-pushed the bug/initialize-properties-before-exit branch from 5ef7740 to 6b5016c Compare November 8, 2023 23:01

@akx akx left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably one mis-import there?

from sd_dynamic_prompts.wildcards_tab import initialize as initialize_wildcards_tab

if TYPE_CHECKING:
from sd_dynamic_prompts.sddp_script import SDDPScript

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
from sd_dynamic_prompts.sddp_script import SDDPScript
from sd_dynamic_prompts.dynamic_prompting import Script as SDDPScript

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants